package com.liuche.pictureserver.process;

import com.liuche.pictureserver.common.exception.ErrorCode;
import com.liuche.pictureserver.pojo.ProcessModel;
import lombok.Data;

/**
 * 责任链执行数据上下文
 *
 * @author liuche
 */
@Data
public class ProcessContext<T extends ProcessModel> {
    /**
     * 责任链业务标识
     */
    private String code;

    /**
     * 传递上下文数据模型
     */
    private T model;

    /**
     * 是否中断责任链
     */
    private boolean breakFlag = false;

    /**
     * 终端责任链报错信息
     */
    private ErrorCode errorCode;

    public ProcessContext(T model) {
        this.model = model;
    }
}
